﻿@model KM.ENT.entNews

@{
    ViewBag.Title = "edit";
    Layout = "~/Areas/Admin/Views/Shared/MasterAdmin.cshtml";
}

<div class="row">

    <div class="col-lg-12">
        <div class="box">
            <div class="box-header">
                <h2><i class="fa fa-edit"></i>Chi tiết sản phẩm</h2>
                <div class="box-icon">
                    <a href="form-elements.html#" class="btn-setting"><i class="fa fa-wrench"></i></a>
                    <a href="form-elements.html#" class="btn-minimize"><i class="fa fa-chevron-up"></i></a>
                    <a href="form-elements.html#" class="btn-close"><i class="fa fa-times"></i></a>
                </div>
            </div>
            <div class="box-content">
                @using (Html.BeginForm("edit", "news", FormMethod.Post, new { @class = "form-horizontal" }))
                {
                    @Html.AntiForgeryToken()
                    @Html.ValidationSummary(true)
                    <table class="table">
                        <tbody>
                            <tr>
                                <td>
                                    <label class="control-label" for="focusedInput">Nhóm tin</label></td>
                                <td>
                                    @Html.DropDownListFor(m => m.GroupNewsId, new SelectList(ViewBag.lstGN, "Id", "Name"), "===Chọn loại sản phẩm===")
                                    @Html.ValidationMessageFor(model => model.GroupNewsId)

                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label class="control-label" for="focusedInput">Tên sản phẩm</label></td>
                                <td>

                                    @Html.HiddenFor(t => t.Id)
                                    @Html.TextBoxFor(model => model.Name, new { @class = "form-control focused" })
                                    @Html.ValidationMessageFor(model => model.Name)

                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <label class="control-label" for="focusedInput">Thứ tự</label></td>
                                <td>

                                    @Html.TextBoxFor(model => model.Index, new { @class = "form-control focused" })
                                    @Html.ValidationMessageFor(model => model.Index)

                                </td>
                            </tr>
                            <tr>
                                <td><label class="control-label" for="focusedInput">Nội dung</label></td>
                                <td>
                                    <div class="form-group">
                                        
                                        <div class="controls">
                                            @Html.TextAreaFor(model => model.Content, new { @class = "adminRichText" })
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="control-label" for="focusedInput">Chi tiết</label></td>
                                <td>
                                    
                                    <div class="controls">
                                        @Html.TextAreaFor(model => model.Detail, new { @class = "adminRichText" })
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td><label class="control-label" for="focusedInput">Title</label></td>
                                <td>
                                    @Html.TextBoxFor(model => model.Title, new { @class = "form-control focused" })
                                    @Html.ValidationMessageFor(model => model.Title)</td>
                            </tr>
                            <tr>
                                <td>
                                    <label class="control-label" for="focusedInput">Description</label></td>
                                <td>@Html.TextBoxFor(model => model.Description, new { @class = "form-control focused" })
                                    @Html.ValidationMessageFor(model => model.Description)</td>

                            </tr>
                            <tr>
                                <td>
                                    <label class="control-label" for="focusedInput">Hình ảnh đại diện</label>
                                </td>
                                <td>
                                    @Html.TextBoxFor(m => m.Image)
                                    <button class="btn" id="anhb" type="button">Cancel</button>
                                </td>
                            </tr>
                           
                            <tr>
                                 <td><label class="control-label" for="focusedInput">Keyword meta</label></td>
                                <td>@Html.TextBoxFor(model => model.Keyword, new { @class = "form-control focused" })</td>
                            </tr>

                        </tbody>
                    </table>
                    <div class="form-actions">
                        <button type="submit" class="btn btn-primary">Save changes</button>
                        <button class="btn" type="reset">Cancel</button>
                    </div>

                }
            </div>
        </div>
    </div>
</div>
@section java
    {
    <!--JavaScript-->
    <script type="text/javascript" src="/content/ckeditor/ckeditor.js"></script>
    <script type="text/javascript" src="/content/ckeditor/adapters/jquery.js"></script>
    <script src="/Content/ckfinder/ckfinder.js" type="text/javascript"></script>
    <style>
        .adminTichText {
            width: 100%;
        }
    </style>
    <script type="text/javascript">
        jQuery(".adminRichText").ckeditor();
    </script>
    <script type="text/javascript">
        var editor; function createEditor(languageCode, id) {
            var editor = CKEDITOR.replace(id, { language: languageCode });
        }
        $("#anhb").click(function () {
            var finder = new CKFinder();
            finder.selectActionFunction = function (fileUrl)
            { $("#Image").val(fileUrl); }; finder.popup();
        });
    </script>

}

